package kr.or.kead.daegu.global.OutputUI;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.border.EmptyBorder;

import kr.or.kead.daegu.global.Config;

public class OutputUI extends JFrame {
	private JTable table;
	private CustomTableModel model;
	/**
	 * Create the frame.
	 * @param tname 
	 */
	public OutputUI(int tname) {
		initialize(tname);
	}
	
	private void initialize(int flag) {
		setBounds(100, 100, 450, 300);
		JPanel contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JScrollPane scrollPane = new JScrollPane();
		contentPane.add(scrollPane, BorderLayout.CENTER);
		
		model = new CustomTableModel(flag, Config.SQL_SELECT[flag]);
		table = new JTable(model);
		scrollPane.setViewportView(table);
		
		setVisible(true);
	}

}
